<template>
  <div>
    <el-row>
      <el-form :inline="true" :model="formInline" class="demo-form-inline">
        <el-form-item>
          <el-input v-model="formInline.user" placeholder="设备编号"></el-input>
        </el-form-item>
        <el-form-item>
          <el-input v-model="formInline.user" placeholder="设备名称"></el-input>
        </el-form-item>
        <el-form-item>
          <el-date-picker
            v-model="formInline.value1"
            type="date"
            placeholder="领取日期">
          </el-date-picker>
        </el-form-item>
        <el-form-item>
          <el-select clearable v-model="formInline.region" placeholder="是否贵重仪器">
            <el-option label="是" value="shanghai"></el-option>
            <el-option label="否" value="beijing"></el-option>
          </el-select>
        </el-form-item>
        <el-form-item>
          <el-select clearable v-model="formInline.region" placeholder="是否易耗品">
            <el-option label="是" value="shanghai"></el-option>
            <el-option label="否" value="beijing"></el-option>
          </el-select>
        </el-form-item>
        <el-form-item>
          <el-select clearable v-model="formInline.region" placeholder="领取单位">
            <el-option label="是" value="shanghai"></el-option>
            <el-option label="否" value="beijing"></el-option>
          </el-select>
        </el-form-item>
        <el-form-item>
          <el-select clearable v-model="formInline.region" placeholder="所有状态">
            <el-option label="是" value="shanghai"></el-option>
            <el-option label="否" value="beijing"></el-option>
          </el-select>
        </el-form-item>
        <el-form-item>
          <el-select clearable v-model="formInline.region" placeholder="仪器分类">
            <el-option label="是" value="shanghai"></el-option>
            <el-option label="否" value="beijing"></el-option>
          </el-select>
        </el-form-item>
        <el-form-item>
          <el-button type="primary" @click="onSubmit">查询</el-button>
        </el-form-item>
      </el-form>
    </el-row>
    <el-row style="margin-bottom: 20px">
      <el-button type="primary"  @click="dialogFormVisible = true">新增</el-button>
      <el-button type="primary"  @click="dialogFormVisible5 = true">日常维保</el-button>
      <el-button type="primary"  @click="dialogFormVisible6 = true">申请报废</el-button>
    </el-row>
    <el-row>
      <el-col>
        <el-table
          :data="tableData"
          style="width: 100%"
          border>
          <el-table-column
            prop="date"
            align="center"
            label="设备编号">
          </el-table-column>
          <el-table-column
            prop="name"
            align="center"
            label="设备名称">
          </el-table-column>
          <el-table-column
            prop="province"
            align="center"
            label="放置地">
          </el-table-column>
          <el-table-column
            prop="city"
            align="center"
            label="领取单位">
          </el-table-column>
          <el-table-column
            prop="address"
            align="center"
            label="领取日期">
          </el-table-column>
          <el-table-column
            prop="zip"
            align="center"
            label="贵重仪器">
          </el-table-column>
          <el-table-column
            prop="zip"
            align="center"
            label="低值易耗品">
          </el-table-column>
          <el-table-column
            prop="zip"
            align="center"
            label="入库日期">
          </el-table-column>
          <el-table-column
            prop="zip"
            align="center"
            label="状态">
          </el-table-column>
          <el-table-column
            align="center"
            width="200px"
            label="操作">
            <template slot-scope="scope">
              <el-button @click="handleClick1(scope.row)" type="text" size="small">查看</el-button>
              <el-button @click="handleClick(scope.row)" type="text" size="small">预约</el-button>
              <el-button @click="handleClick2(scope.row)" type="text" size="small">延期</el-button>
              <el-button @click="handleClick3(scope.row)" type="text" size="small">损坏登记</el-button>
            </template>
          </el-table-column>
        </el-table>
        <el-pagination
          background
          style="margin-top: 10px;text-align: right"
          layout="prev, pager, next"
          :total="1000">
        </el-pagination>
      </el-col>
    </el-row>
    <el-dialog title="设备档案" :visible.sync="dialogFormVisible1" width="80%">
      <el-row>
        <el-col :span="18">
          <el-form :model="form">
            <el-form-item label="设备名称" :label-width="formLabelWidth">
              <span>烧杯</span>
            </el-form-item>
            <el-form-item label="设备编号" :label-width="formLabelWidth">
              <span>A001</span>
            </el-form-item>
            <el-form-item label="设备二维码" :label-width="formLabelWidth">
              <img width="200px" src="../../assets/img/timg.jpg" alt="">
            </el-form-item>
            <el-form-item label="设备说明" :label-width="formLabelWidth">
              <span>化学类用品</span>
            </el-form-item>
            <el-form-item label="放置地" :label-width="formLabelWidth">
              <span>仓库1右侧一排一行第3个</span>
            </el-form-item>
            <el-form-item label="入库时间" :label-width="formLabelWidth">
              <el-col>
                <span>2020-08-19</span>
              </el-col>
            </el-form-item>
            <el-form-item label="购置时间" :label-width="formLabelWidth">
              <el-col>
                <span>2020-08-10</span>
              </el-col>
            </el-form-item>
            <el-form-item label="地图实时位置" :label-width="formLabelWidth">
              <img width="200px" src="../../assets/img/map.jpg" alt="">
            </el-form-item>
            <el-form-item label="贵重仪器" :label-width="formLabelWidth">
              <span>否</span>
            </el-form-item>
            <el-form-item label="低值易耗品" :label-width="formLabelWidth">
              <span>是</span>
            </el-form-item>
            <el-form-item label="仪器分类" :label-width="formLabelWidth">
              <span>教学用仪器</span>
            </el-form-item>
            <el-form-item label="操作规程" :label-width="formLabelWidth">
              <span>操作文件1</span>
              <span>操作文件2</span>
            </el-form-item>
          </el-form>
        </el-col>
        <el-col :span="4" :offset="2">
          <div class="block">
            <el-timeline>
              <el-timeline-item
                v-for="(activity, index) in activities"
                :key="index"
                :icon="activity.icon"
                :type="activity.type"
                :color="activity.color"
                :size="activity.size"
                :timestamp="activity.timestamp">
                {{activity.content}}
              </el-timeline-item>
            </el-timeline>
          </div>
        </el-col>
      </el-row>

      <div slot="footer" class="dialog-footer">
        <el-button @click="dialogFormVisible1 = false">取 消</el-button>
        <el-button type="primary" @click="dialogFormVisible1 = false">确 定</el-button>
      </div>
    </el-dialog>
    <el-dialog title="设备存档" :visible.sync="dialogFormVisible" width="40%">
      <el-form :model="form">
        <el-form-item label="设备名称" :label-width="formLabelWidth">
          <el-input v-model="form.name" autocomplete="off"></el-input>
        </el-form-item>
        <el-form-item label="设备编号" :label-width="formLabelWidth">
          <el-input v-model="form.name" autocomplete="off" placeholder="自动生成"></el-input>
        </el-form-item>
        <el-form-item label="设备二维码" :label-width="formLabelWidth">
          <el-upload
            class="upload-demo"
            drag
            action="https://jsonplaceholder.typicode.com/posts/"
            multiple>
            <i class="el-icon-upload"></i>
            <div class="el-upload__text">生成</div>
            <!--<div class="el-upload__tip" slot="tip">只能上传jpg/png文件，且不超过500kb</div>-->
          </el-upload>
        </el-form-item>
        <el-form-item label="设备说明" :label-width="formLabelWidth">
          <el-input type="textarea" v-model="form.desc"></el-input>
        </el-form-item>
        <el-form-item label="放置地" :label-width="formLabelWidth">
          <el-input v-model="form.name" autocomplete="off" placeholder="自动生成"></el-input>
        </el-form-item>
        <el-form-item label="入库时间" :label-width="formLabelWidth">
          <el-col>
            <el-date-picker type="date" placeholder="选择日期" v-model="form.date1" style="width: 100%;"></el-date-picker>
          </el-col>
        </el-form-item>
        <el-form-item label="购置时间" :label-width="formLabelWidth">
          <el-col>
            <el-date-picker type="date" placeholder="选择日期" v-model="form.date1" style="width: 100%;"></el-date-picker>
          </el-col>
        </el-form-item>
        <el-form-item label="贵重仪器" :label-width="formLabelWidth">
          <el-radio-group v-model="form.resource">
            <el-radio label="是"></el-radio>
            <el-radio label="否"></el-radio>
          </el-radio-group>
        </el-form-item>
        <el-form-item label="低值易耗品" :label-width="formLabelWidth">
          <el-radio-group v-model="form.resource">
            <el-radio label="是"></el-radio>
            <el-radio label="否"></el-radio>
          </el-radio-group>
        </el-form-item>
        <el-form-item label="仪器分类" :label-width="formLabelWidth">
          <el-checkbox-group v-model="form.type">
            <el-checkbox label="竞赛用仪器" name="type"></el-checkbox>
            <el-checkbox label="教学用仪器" name="type"></el-checkbox>
          </el-checkbox-group>
        </el-form-item>
        <el-form-item label="操作规程" :label-width="formLabelWidth">
          <el-upload
            class="upload-demo"
            drag
            action="https://jsonplaceholder.typicode.com/posts/"
            multiple>
            <i class="el-icon-upload"></i>
            <div class="el-upload__text">将文件拖到此处，或<em>点击上传</em></div>
            <!--<div class="el-upload__tip" slot="tip">只能上传jpg/png文件，且不超过500kb</div>-->
          </el-upload>
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button @click="dialogFormVisible = false">取 消</el-button>
        <el-button type="primary" @click="dialogFormVisible = false">确 定</el-button>
      </div>
    </el-dialog>
    <el-dialog title="设备预约" :visible.sync="dialogFormVisible2" width="40%">
      <el-form :model="form">
        <el-form-item label="设备名称" :label-width="formLabelWidth">
          <span>烧杯</span>
        </el-form-item>
        <el-form-item label="设备类型" :label-width="formLabelWidth">
          <span>贵重仪器 否；低值消耗品 否；教学用仪器</span>
        </el-form-item>
        <el-form-item label="专业" :label-width="formLabelWidth">
          <el-select clearable v-model="form.region" placeholder="专业">
            <el-option label="专业1" value="shanghai"></el-option>
            <el-option label="专业2" value="beijing"></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="班级" :label-width="formLabelWidth">
          <el-select clearable v-model="form.region" placeholder="班级">
            <el-option label="班级1" value="shanghai"></el-option>
            <el-option label="班级2" value="beijing"></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="课程" :label-width="formLabelWidth">
          <el-select clearable v-model="form.region" placeholder="课程">
            <el-option label="课程1" value="shanghai"></el-option>
            <el-option label="课程2" value="beijing"></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="人数" :label-width="formLabelWidth">
          <el-select clearable v-model="form.region" placeholder="人数">
            <el-option label="人数1" value="shanghai"></el-option>
            <el-option label="人数2" value="beijing"></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="库存" :label-width="formLabelWidth">
          <span>199</span>
        </el-form-item>
        <el-form-item label="使用时间" :label-width="formLabelWidth">
          <el-col>
            <el-date-picker type="date" placeholder="选择日期" v-model="form.date1" style="width: 100%;"></el-date-picker>
          </el-col>
        </el-form-item>
        <el-form-item label="归还时间" :label-width="formLabelWidth">
          <el-col>
            <el-date-picker type="date" placeholder="选择日期" v-model="form.date1" style="width: 100%;"></el-date-picker>
          </el-col>
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button @click="dialogFormVisible2 = false">取 消</el-button>
        <el-button type="primary" @click="dialogFormVisible2 = false">确 定</el-button>
      </div>
    </el-dialog>
    <el-dialog title="延期申请" :visible.sync="dialogFormVisible3" width="40%">
      <el-form :model="form">
        <el-form-item label="设备名称" :label-width="formLabelWidth">
          <span>烧杯</span>
        </el-form-item>
        <el-form-item label="设备类型" :label-width="formLabelWidth">
          <span>贵重仪器 否；低值消耗品 否；教学用仪器</span>
        </el-form-item>
        <el-form-item label="专业" :label-width="formLabelWidth">
          <el-select clearable v-model="form.region" placeholder="专业">
            <el-option label="专业1" value="shanghai"></el-option>
            <el-option label="专业2" value="beijing"></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="班级" :label-width="formLabelWidth">
          <el-select clearable v-model="form.region" placeholder="班级">
            <el-option label="班级1" value="shanghai"></el-option>
            <el-option label="班级2" value="beijing"></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="课程" :label-width="formLabelWidth">
          <el-select clearable v-model="form.region" placeholder="课程">
            <el-option label="课程1" value="shanghai"></el-option>
            <el-option label="课程2" value="beijing"></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="人数" :label-width="formLabelWidth">
          <el-select clearable v-model="form.region" placeholder="人数">
            <el-option label="人数1" value="shanghai"></el-option>
            <el-option label="人数2" value="beijing"></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="使用时间" :label-width="formLabelWidth">
          <el-col>
            <el-date-picker type="date" placeholder="选择日期" v-model="form.date1" style="width: 100%;"></el-date-picker>
          </el-col>
        </el-form-item>
        <el-form-item label="归还时间" :label-width="formLabelWidth">
          <el-col>
            <el-date-picker type="date" placeholder="选择日期" v-model="form.date1" style="width: 100%;"></el-date-picker>
          </el-col>
        </el-form-item>
        <el-form-item label="延期时间" :label-width="formLabelWidth">
          <el-col>
            <el-date-picker type="date" placeholder="选择日期" v-model="form.date1" style="width: 100%;"></el-date-picker>
          </el-col>
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button @click="dialogFormVisible3 = false">取 消</el-button>
        <el-button type="primary" @click="dialogFormVisible3 = false">确 定</el-button>
      </div>
    </el-dialog>
    <el-dialog title="损害登记" :visible.sync="dialogFormVisible4" width="40%">
      <el-form :model="form">
        <el-form-item label="设备名称" :label-width="formLabelWidth">
          <span>烧杯</span>
        </el-form-item>
        <el-form-item label="设备类型" :label-width="formLabelWidth">
          <span>贵重仪器 否；低值消耗品 否；教学用仪器</span>
        </el-form-item>
        <el-form-item label="专业" :label-width="formLabelWidth">
          <el-select clearable v-model="form.region" placeholder="专业">
            <el-option label="专业1" value="shanghai"></el-option>
            <el-option label="专业2" value="beijing"></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="班级" :label-width="formLabelWidth">
          <el-select clearable v-model="form.region" placeholder="班级">
            <el-option label="班级1" value="shanghai"></el-option>
            <el-option label="班级2" value="beijing"></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="责任人" :label-width="formLabelWidth">
          <el-select clearable v-model="form.region" placeholder="课程">
            <el-option label="责任人1" value="shanghai"></el-option>
            <el-option label="责任人2" value="beijing"></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="赔付价格" :label-width="formLabelWidth">
          <el-input v-model="form.name" autocomplete="off"></el-input>
        </el-form-item>
        <el-form-item label="是否赔付" :label-width="formLabelWidth">
          <el-radio-group v-model="form.resource">
            <el-radio label="是"></el-radio>
            <el-radio label="否"></el-radio>
          </el-radio-group>
        </el-form-item>
        <el-form-item label="使用时间" :label-width="formLabelWidth">
          <el-col>
            <el-date-picker type="date" placeholder="选择日期" v-model="form.date1" style="width: 100%;"></el-date-picker>
          </el-col>
        </el-form-item>
        <el-form-item label="损坏时间" :label-width="formLabelWidth">
          <el-col>
            <el-date-picker type="date" placeholder="选择日期" v-model="form.date1" style="width: 100%;"></el-date-picker>
          </el-col>
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button @click="dialogFormVisible4 = false">取 消</el-button>
        <el-button type="primary" @click="dialogFormVisible4= false">确 定</el-button>
      </div>
    </el-dialog>
    <el-dialog title="日常维保" :visible.sync="dialogFormVisible5" width="40%">
      <el-form :model="form">
        <el-form-item label="设备名称" :label-width="formLabelWidth">
          <span>烧杯</span>
        </el-form-item>
        <el-form-item label="设备编号" :label-width="formLabelWidth">
          <span>A001</span>
        </el-form-item>
        <el-form-item label="设备说明" :label-width="formLabelWidth">
          <span>化学使用</span>
        </el-form-item>
        <el-form-item label="放置地" :label-width="formLabelWidth">
          <span>A仓库</span>
        </el-form-item>
        <el-form-item label="入库时间" :label-width="formLabelWidth">
          <el-col>
            <span>2020-08-19</span>
          </el-col>
        </el-form-item>
        <el-form-item label="购置时间" :label-width="formLabelWidth">
          <el-col>
            <span>2020-08-10</span>
          </el-col>
        </el-form-item>
        <el-form-item label="仪器分类" :label-width="formLabelWidth">
          <span>教学用仪器</span>
        </el-form-item>
        <el-form-item label="计划维保日期" :label-width="formLabelWidth">
          <el-col>
            <el-date-picker type="date" placeholder="选择日期" v-model="form.date1" style="width: 100%;"></el-date-picker>
          </el-col>
        </el-form-item>
        <el-form-item label="维保内容" :label-width="formLabelWidth">
          <el-input type="textarea" v-model="form.desc"></el-input>
        </el-form-item>
        <el-form-item label="图片上传" :label-width="formLabelWidth">
          <el-upload
            class="upload-demo"
            drag
            action="https://jsonplaceholder.typicode.com/posts/"
            multiple>
            <i class="el-icon-upload"></i>
            <div class="el-upload__text">将文件拖到此处，或<em>点击上传</em></div>
            <!--<div class="el-upload__tip" slot="tip">只能上传jpg/png文件，且不超过500kb</div>-->
          </el-upload>
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button @click="dialogFormVisible5 = false">取 消</el-button>
        <el-button type="primary" @click="dialogFormVisible5 = false">确 定</el-button>
      </div>
    </el-dialog>
    <el-dialog title="申请报废" :visible.sync="dialogFormVisible6" width="40%">
      <el-form :model="form">
        <el-form-item label="设备名称" :label-width="formLabelWidth">
          <span>烧杯</span>
        </el-form-item>
        <el-form-item label="设备编号" :label-width="formLabelWidth">
          <span>A001</span>
        </el-form-item>
        <el-form-item label="设备说明" :label-width="formLabelWidth">
          <span>化学使用</span>
        </el-form-item>
        <el-form-item label="放置地" :label-width="formLabelWidth">
          <span>A仓库</span>
        </el-form-item>
        <el-form-item label="入库时间" :label-width="formLabelWidth">
          <el-col>
            <span>2020-08-19</span>
          </el-col>
        </el-form-item>
        <el-form-item label="购置时间" :label-width="formLabelWidth">
          <el-col>
            <span>2020-08-10</span>q
          </el-col>
        </el-form-item>
        <el-form-item label="仪器分类" :label-width="formLabelWidth">
          <span>教学用仪器</span>
        </el-form-item>
        <el-form-item label="报废日期" :label-width="formLabelWidth">
          <el-col>
            <el-date-picker type="date" placeholder="选择日期" v-model="form.date1" style="width: 100%;"></el-date-picker>
          </el-col>
        </el-form-item>
        <el-form-item label="报废原因" :label-width="formLabelWidth">
          <el-input type="textarea" v-model="form.desc"></el-input>
        </el-form-item>
        <el-form-item label="图片上传" :label-width="formLabelWidth">
          <el-upload
            class="upload-demo"
            drag
            action="https://jsonplaceholder.typicode.com/posts/"
            multiple>
            <i class="el-icon-upload"></i>
            <div class="el-upload__text">将文件拖到此处，或<em>点击上传</em></div>
            <!--<div class="el-upload__tip" slot="tip">只能上传jpg/png文件，且不超过500kb</div>-->
          </el-upload>
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button @click="dialogFormVisible6 = false">取 消</el-button>
        <el-button type="primary" @click="dialogFormVisible6 = false">确 定</el-button>
      </div>
    </el-dialog>
  </div>
</template>

<script>
  export default {
    name: "deviceList",
    data() {
      return {
        formInline: {},
        tableData: [{
          date: '2016-05-02',
          name: '王小虎',
          province: '陕西',
          city: '计算机科学与应用',
          address: '陕西省西安市',
          zip: 200333
        }, {
          date: '2016-05-04',
          name: '王小虎',
          province: '陕西',
          city: '计算机科学与应用',
          address: '陕西省西安市',
          zip: 200333
        }, {
          date: '2016-05-01',
          name: '王小虎',
          province: '陕西',
          city: '计算机科学与应用',
          address: '陕西省西安市',
          zip: 200333
        }, {
          date: '2016-05-03',
          name: '王小虎',
          province: '陕西',
          city: '计算机科学与应用',
          address: '陕西省西安市',
          zip: 200333
        }],
        dialogFormVisible: false,
        dialogFormVisible1: false,
        dialogFormVisible2: false,
        dialogFormVisible3: false,
        dialogFormVisible4: false,
        dialogFormVisible5: false,
        dialogFormVisible6: false,
        form: {
          name: '',
          region: '',
          date1: '',
          date2: '',
          delivery: false,
          type: [],
          resource: '',
          desc: ''
        },
        formLabelWidth: '120px',
        activities: [{
          content: '入库日期',
          timestamp: '2018-04-12 20:46',
          size: 'large',
          type: 'primary',
          icon: 'el-icon-more'
        }, {
          content: '第一次出借日期',
          timestamp: '2018-04-03 20:46',
          color: '#0bbd87'
        }, {
          content: '第一次归还日期',
          timestamp: '2018-04-03 20:46',
          size: 'large'
        }, {
          content: '第二次出借日期',
          timestamp: '2018-04-03 20:46'
        },
          {
            content: '第一次维修',
            timestamp: '2018-04-03 20:46'
          },
          {
            content: '第一次维保',
            timestamp: '2018-04-03 20:46'
          },
          {
            content: '报废',
            timestamp: '2018-04-03 20:46'
          }]
      }
    },
    methods: {
      handleClick(row) {
        console.log(row);
        this.dialogFormVisible2 = true
      },
      handleClick2(row) {
        console.log(row);
        this.dialogFormVisible3 = true
      },
      handleClick3(row) {
        console.log(row);
        this.dialogFormVisible4 = true
      },
      handleClick1(row) {
        console.log(row);
        this.dialogFormVisible1 = true
      },
    },
  }
</script>

<style scoped>

</style>
